<template>
  <LoginBox :userInfo="userInfo"/>
  <CenterList/>
</template>
<script setup>
import LoginBox from "@/components/loginBox/loginBox.vue";
import CenterList from '@/components/centerList/index.vue'
import { apiCheckToken } from "@/server/business/survey.js";
import { useRoute } from "vue-router";
import { ref } from "vue";

const route = useRoute()?.query
const userInfo = ref({})
// 获取登录者信息
const getUserInfo = () => {
  if (!route.token || ["#token%23", "#token#"].includes(route.token)) {
    resolve();
  } else {
    apiCheckToken({ memberUserToken: route.token }).then((res) => {
      localStorage.userInfo = JSON.stringify(res.data);
      for (let key in res.data) {
        userInfo.value[key] = res.data[key];
      }
    })
  }
};
getUserInfo()
</script>
<style lang="less" scoped>

</style>
